<template>
  <panel>

    <el-row>
      <el-button type="info" size="small" @click="open1">消息提示</el-button>
      <el-button type="info" size="small" @click="open2">确认消息</el-button>
      <el-button type="info" size="small" @click="dialogFormVisible = true">提交内容</el-button>

      <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
        <el-form :model="form">
          <el-form-item label="活动名称">
            <el-input v-model="form.name" size="small" auto-complete="off"></el-input>
          </el-form-item>
          <el-form-item label="活动区域">
            <el-select v-model="form.region" size="small" placeholder="请选择活动区域" style="width: 100%">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
        </div>
      </el-dialog>


      <p class="mt20">详细信息查看：http://element.eleme.io/#/zh-CN/component/message-box</p>
    </el-row>

    <el-row class="mt20">
      <el-button type="info" size="small" @click="open4">成功</el-button>
      <el-button type="info" size="small" @click="open5">警告</el-button>
      <el-button type="info" size="small" @click="open6">消息</el-button>
      <el-button type="info" size="small" @click="open7">错误</el-button>
      <p class="mt20">详细信息查看：http://element.eleme.io/#/zh-CN/component/message</p>
    </el-row>



  </panel>
</template>

<script>
  export default {
    data() {
      return {
        form: {
          name: '',
          region: ''
        },
        dialogFormVisible: false
      }
    },
    methods: {
      open1() {
        this.$alert('这是一段内容', '标题名称', {
          confirmButtonText: '确定',
          callback: action => {
            this.$message({
              type: 'info',
              message: `action: ${ action }`
            });
          }
        });
      },

      open2() {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
      },

      open4() {
        this.$message({
          message: '恭喜你，这是一条成功消息',
          type: 'success'
        });
      },

      open5() {
        this.$message({
          message: '警告哦，这是一条警告消息',
          type: 'warning'
        });
      },

      open6() {
        this.$message('这是一条消息提示');
      },

      open7() {
        this.$message.error('错了哦，这是一条错误消息');
      }
    }
  }
</script>

<style>

</style>
